<?php 
namespace App\Services;

use App\Facades\Infra\DoctorManage;

class DoctorService{

	public function getDoctor(){

		$conditions['openid'] = session('wechat.oauth_user')->getId();

		// dd($conditions);

		return DoctorManage::getDoctor($conditions)->first();

	}

	public function getErweima(){

		$wechat = app('wechat');

		$qrcode = $wechat->qrcode;

		$doctor = $this->getDoctor();

		$ticker = $doctor->wechatDoctorInfo->ticket;

		return $qrcode->url($ticker);
	}
}